package com.starleague.common;

import java.util.LinkedHashMap;
import java.util.Map;

import com.starleague.common.HasInfoProperties;

public abstract class AbstractHasInfoProperties
        implements HasInfoProperties
{
    protected AbstractHasInfoProperties()
    {
        //
    }

    @Override
    public Map<String, Object> infoProperties()
    {
        Map<String, Object> infoPropertyMap = new LinkedHashMap<String, Object>();
        infoPropertyMap.put("hash", this.hashCode());
        return infoPropertyMap;
    }

    @Override
    public String infoPropertyClassName()
    {
        return getClass().getSimpleName();
    }

    public String toString(int depth)
    {
        return HasInfoProperties.Dumper.toString(this, depth);
    }

    @Override
    public String toString()
    {
        return toString(Integer.MAX_VALUE);
    }
}
